import 'dart:async';
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_demo/http/api.dart';
import 'package:flutter_demo/other/application.dart';
import 'package:flutter_demo/widget/cards.dart';
import 'package:flutter_demo/widget/screen_load.dart';
import 'package:fluttertoast/fluttertoast.dart';

import 'widget/tiny_widgets.dart';

class PersonalInfoScreen extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _PersonalInfoScreenState();
}

class _PersonalInfoScreenState 
    extends State<PersonalInfoScreen> with ScreenLoadMixin {

  Map<String, dynamic> data = {
    '个人账号' : 'SuperLearner',
    '姓名' : '陈垍谋',
    '绑定邮箱' : '1721554825@qq.com',
    '绑定电话' : '18775248292',
    '所属公司统一社会信用代码' : '123456789012345678',
    '身份证号码' : '450203200011081310',
    '职称' : '安卓开发工程师',
    '姓名启用状态' : '否',
  };
  
  @override
  void initState() {
    super.initState();
    Timer(Duration(milliseconds: 1000), () => loadFinish());
  }
  
  @override
  Widget buildChild(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('个人信息'),
      ),
      body: Center(
        child: DataCard(
          width: 610,
          height: 500,
          params: data,
        ),
      ),
    );
  }

  // void loadData() async {
  //   Response response = await SystemApi.see_person_infor(Application.currentAccount);
  //   if (response.statusCode == 200) {
  //     data = json.decode(response.data);
  //     loadFinish();
  //   } else {
  //     Fluttertoast.showToast(msg: response.statusCode.toString());
  //   }
  // }
}